package com.yenlien.traceyun.breed.dao;

import java.util.List;

import org.springframework.data.jpa.repository.Query;

import com.alibaba.fastjson.JSONObject;
import com.yenlien.traceyun.breed.entity.Breed;
import com.yenlien.traceyun.webase.dao.BaseJpaDao;

public interface BreedDao extends BaseJpaDao<Breed> {

    Breed findById(String id);

    Breed findByBatch(String batch);

    @Query(value = "select id,batch from t_breed", nativeQuery = true)
    List<JSONObject> findAllBatch();

    @Query(value = "select id,batch from t_breed where source=?1", nativeQuery = true)
    List<JSONObject> findTypeAllBatch(String type);

}
